<template>
  <div class="app-container">
<!--    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">-->
<!--      <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" prop="sb1">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb1"-->
<!--          placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" prop="sb2">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb2"-->
<!--          placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" prop="sb3">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb3"-->
<!--          placeholder="请输入N2O 排放因子 N2O EF(g N2O/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="2009 CO2e排放因子 CO2e EF" prop="sb4">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb4"-->
<!--          placeholder="请输入2009 CO2e排放因子 CO2e EF"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" prop="sb5">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb5"-->
<!--          placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" prop="sb6">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb6"-->
<!--          placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" prop="sb7">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb7"-->
<!--          placeholder="请输入N2O 排放因子 N2O EF(g N2O/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="2010 CO2e排放因子 CO2e EF" prop="sb8">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb8"-->
<!--          placeholder="请输入2010 CO2e排放因子 CO2e EF"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" prop="sb9">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb9"-->
<!--          placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" prop="sb10">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb10"-->
<!--          placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" prop="sb11">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb11"-->
<!--          placeholder="请输入N2O 排放因子 N2O EF(g N2O/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="2011 CO2e排放因子 CO2e EF" prop="sb12">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb12"-->
<!--          placeholder="请输入2011 CO2e排放因子 CO2e EF"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label=" CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" prop="sb13">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb13"-->
<!--          placeholder="请输入 CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" prop="sb14">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb14"-->
<!--          placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" prop="sb15">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb15"-->
<!--          placeholder="请输入N2O 排放因子 N2O EF(g N2O/10^6 kJ)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="2006 " prop="sb16">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb16"-->
<!--          placeholder="请输入2006 "-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb17">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb17"-->
<!--          placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb18">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb18"-->
<!--          placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb19">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb19"-->
<!--          placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="2007 " prop="sb20">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb20"-->
<!--          placeholder="请输入2007 "-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb21">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb21"-->
<!--          placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb22">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb22"-->
<!--          placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb23">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb23"-->
<!--          placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="2008 " prop="sb24">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb24"-->
<!--          placeholder="请输入2008 "-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb25">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb25"-->
<!--          placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb26">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb26"-->
<!--          placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb27">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb27"-->
<!--          placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="2009 " prop="sb28">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb28"-->
<!--          placeholder="请输入2009 "-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb29">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb29"-->
<!--          placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb30">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb30"-->
<!--          placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb31">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb31"-->
<!--          placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="2010 " prop="sb32">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb32"-->
<!--          placeholder="请输入2010 "-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb33">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb33"-->
<!--          placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb34">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb34"-->
<!--          placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb35">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb35"-->
<!--          placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="2011 " prop="sb36">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb36"-->
<!--          placeholder="请输入2011 "-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb37">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb37"-->
<!--          placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb38">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb38"-->
<!--          placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb39">-->
<!--        <el-input-->
<!--          v-model="queryParams.sb39"-->
<!--          placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)"-->
<!--          clearable-->
<!--          size="small"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item>-->
<!--        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
<!--        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
<!--      </el-form-item>-->
<!--    </el-form>-->

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['busi:companyGrid:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['busi:companyGrid:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['busi:companyGrid:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          :loading="exportLoading"
          @click="handleExport"
          v-hasPermi="['busi:companyGrid:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="companyGridList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="" align="center" prop="id" v-if="false"/>
      <el-table-column label="CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" align="center" prop="sb1" />
      <el-table-column label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" align="center" prop="sb2" />
      <el-table-column label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" align="center" prop="sb3" />
      <el-table-column label="2009 CO2e排放因子 CO2e EF" align="center" prop="sb4" />
      <el-table-column label="CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" align="center" prop="sb5" />
      <el-table-column label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" align="center" prop="sb6" />
      <el-table-column label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" align="center" prop="sb7" />
      <el-table-column label="2010 CO2e排放因子 CO2e EF" align="center" prop="sb8" />
      <el-table-column label="CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" align="center" prop="sb9" />
      <el-table-column label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" align="center" prop="sb10" />
      <el-table-column label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" align="center" prop="sb11" />
      <el-table-column label="2011 CO2e排放因子 CO2e EF" align="center" prop="sb12" />
      <el-table-column label=" CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" align="center" prop="sb13" />
      <el-table-column label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" align="center" prop="sb14" />
      <el-table-column label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" align="center" prop="sb15" />
      <el-table-column label="2006 " align="center" prop="sb16" />
      <el-table-column label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" align="center" prop="sb17" />
      <el-table-column label="CH4 排放因子 CH4 EF (g CH4/10MWh)" align="center" prop="sb18" />
      <el-table-column label="N2O 排放因子 N2O EF(g N2O/10MWh)" align="center" prop="sb19" />
      <el-table-column label="2007 " align="center" prop="sb20" />
      <el-table-column label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" align="center" prop="sb21" />
      <el-table-column label="CH4 排放因子 CH4 EF (g CH4/10MWh)" align="center" prop="sb22" />
      <el-table-column label="N2O 排放因子 N2O EF(g N2O/10MWh)" align="center" prop="sb23" />
      <el-table-column label="2008 " align="center" prop="sb24" />
      <el-table-column label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" align="center" prop="sb25" />
      <el-table-column label="CH4 排放因子 CH4 EF (g CH4/10MWh)" align="center" prop="sb26" />
      <el-table-column label="N2O 排放因子 N2O EF(g N2O/10MWh)" align="center" prop="sb27" />
      <el-table-column label="2009 " align="center" prop="sb28" />
      <el-table-column label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" align="center" prop="sb29" />
      <el-table-column label="CH4 排放因子 CH4 EF (g CH4/10MWh)" align="center" prop="sb30" />
      <el-table-column label="N2O 排放因子 N2O EF(g N2O/10MWh)" align="center" prop="sb31" />
      <el-table-column label="2010 " align="center" prop="sb32" />
      <el-table-column label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" align="center" prop="sb33" />
      <el-table-column label="CH4 排放因子 CH4 EF (g CH4/10MWh)" align="center" prop="sb34" />
      <el-table-column label="N2O 排放因子 N2O EF(g N2O/10MWh)" align="center" prop="sb35" />
      <el-table-column label="2011 " align="center" prop="sb36" />
      <el-table-column label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" align="center" prop="sb37" />
      <el-table-column label="CH4 排放因子 CH4 EF (g CH4/10MWh)" align="center" prop="sb38" />
      <el-table-column label="N2O 排放因子 N2O EF(g N2O/10MWh)" align="center" prop="sb39" />
      <el-table-column label="操作" align="center" width="155" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['busi:companyGrid:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['busi:companyGrid:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改排放因子对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1100px" height="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="280px">
        <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" prop="sb1">
          <el-input v-model="form.sb1" placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" prop="sb2">
          <el-input v-model="form.sb2" placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" prop="sb3">
          <el-input v-model="form.sb3" placeholder="请输入N2O 排放因子 N2O EF(g N2O/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="2009 CO2e排放因子 CO2e EF" prop="sb4">
          <el-input v-model="form.sb4" placeholder="请输入2009 CO2e排放因子 CO2e EF" />
        </el-form-item>
        <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" prop="sb5">
          <el-input v-model="form.sb5" placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" prop="sb6">
          <el-input v-model="form.sb6" placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" prop="sb7">
          <el-input v-model="form.sb7" placeholder="请输入N2O 排放因子 N2O EF(g N2O/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="2010 CO2e排放因子 CO2e EF" prop="sb8">
          <el-input v-model="form.sb8" placeholder="请输入2010 CO2e排放因子 CO2e EF" />
        </el-form-item>
        <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" prop="sb9">
          <el-input v-model="form.sb9" placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" prop="sb10">
          <el-input v-model="form.sb10" placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" prop="sb11">
          <el-input v-model="form.sb11" placeholder="请输入N2O 排放因子 N2O EF(g N2O/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="2011 CO2e排放因子 CO2e EF" prop="sb12">
          <el-input v-model="form.sb12" placeholder="请输入2011 CO2e排放因子 CO2e EF" />
        </el-form-item>
        <el-form-item label=" CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" prop="sb13">
          <el-input v-model="form.sb13" placeholder="请输入 CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" prop="sb14">
          <el-input v-model="form.sb14" placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="N2O 排放因子 N2O EF(g N2O/10^6 kJ)" prop="sb15">
          <el-input v-model="form.sb15" placeholder="请输入N2O 排放因子 N2O EF(g N2O/10^6 kJ)" />
        </el-form-item>
        <el-form-item label="2006 " prop="sb16">
          <el-input v-model="form.sb16" placeholder="请输入2006 " />
        </el-form-item>
        <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb17">
          <el-input v-model="form.sb17" placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)" />
        </el-form-item>
        <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb18">
          <el-input v-model="form.sb18" placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)" />
        </el-form-item>
        <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb19">
          <el-input v-model="form.sb19" placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)" />
        </el-form-item>
        <el-form-item label="2007 " prop="sb20">
          <el-input v-model="form.sb20" placeholder="请输入2007 " />
        </el-form-item>
        <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb21">
          <el-input v-model="form.sb21" placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)" />
        </el-form-item>
        <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb22">
          <el-input v-model="form.sb22" placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)" />
        </el-form-item>
        <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb23">
          <el-input v-model="form.sb23" placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)" />
        </el-form-item>
        <el-form-item label="2008 " prop="sb24">
          <el-input v-model="form.sb24" placeholder="请输入2008 " />
        </el-form-item>
        <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb25">
          <el-input v-model="form.sb25" placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)" />
        </el-form-item>
        <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb26">
          <el-input v-model="form.sb26" placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)" />
        </el-form-item>
        <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb27">
          <el-input v-model="form.sb27" placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)" />
        </el-form-item>
        <el-form-item label="2009 " prop="sb28">
          <el-input v-model="form.sb28" placeholder="请输入2009 " />
        </el-form-item>
        <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb29">
          <el-input v-model="form.sb29" placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)" />
        </el-form-item>
        <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb30">
          <el-input v-model="form.sb30" placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)" />
        </el-form-item>
        <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb31">
          <el-input v-model="form.sb31" placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)" />
        </el-form-item>
        <el-form-item label="2010 " prop="sb32">
          <el-input v-model="form.sb32" placeholder="请输入2010 " />
        </el-form-item>
        <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb33">
          <el-input v-model="form.sb33" placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)" />
        </el-form-item>
        <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb34">
          <el-input v-model="form.sb34" placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)" />
        </el-form-item>
        <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb35">
          <el-input v-model="form.sb35" placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)" />
        </el-form-item>
        <el-form-item label="2011 " prop="sb36">
          <el-input v-model="form.sb36" placeholder="请输入2011 " />
        </el-form-item>
        <el-form-item label="CO2 排放因子 CO2 EF (ton CO2/10MWh)" prop="sb37">
          <el-input v-model="form.sb37" placeholder="请输入CO2 排放因子 CO2 EF (ton CO2/10MWh)" />
        </el-form-item>
        <el-form-item label="CH4 排放因子 CH4 EF (g CH4/10MWh)" prop="sb38">
          <el-input v-model="form.sb38" placeholder="请输入CH4 排放因子 CH4 EF (g CH4/10MWh)" />
        </el-form-item>
        <el-form-item label="N2O 排放因子 N2O EF(g N2O/10MWh)" prop="sb39">
          <el-input v-model="form.sb39" placeholder="请输入N2O 排放因子 N2O EF(g N2O/10MWh)" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listCompanyGrid, getCompanyGrid, delCompanyGrid, addCompanyGrid, updateCompanyGrid } from "@/api/busi/companyGrid";

export default {
  name: "CompanyGrid",
  data() {
    return {
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 排放因子表格数据
      companyGridList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        sb1: undefined,
        sb2: undefined,
        sb3: undefined,
        sb4: undefined,
        sb5: undefined,
        sb6: undefined,
        sb7: undefined,
        sb8: undefined,
        sb9: undefined,
        sb10: undefined,
        sb11: undefined,
        sb12: undefined,
        sb13: undefined,
        sb14: undefined,
        sb15: undefined,
        sb16: undefined,
        sb17: undefined,
        sb18: undefined,
        sb19: undefined,
        sb20: undefined,
        sb21: undefined,
        sb22: undefined,
        sb23: undefined,
        sb24: undefined,
        sb25: undefined,
        sb26: undefined,
        sb27: undefined,
        sb28: undefined,
        sb29: undefined,
        sb30: undefined,
        sb31: undefined,
        sb32: undefined,
        sb33: undefined,
        sb34: undefined,
        sb35: undefined,
        sb36: undefined,
        sb37: undefined,
        sb38: undefined,
        sb39: undefined
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        id: [
          { required: false, message: "不能为空", trigger: "blur" }
        ],
        sb1: [
          { required: false, message: "CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb2: [
          { required: false, message: "CH4 排放因子 CH4 EF (g CH4/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb3: [
          { required: false, message: "N2O 排放因子 N2O EF(g N2O/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb4: [
          { required: false, message: "2009 CO2e排放因子 CO2e EF不能为空", trigger: "blur" }
        ],
        sb5: [
          { required: false, message: "CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb6: [
          { required: false, message: "CH4 排放因子 CH4 EF (g CH4/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb7: [
          { required: false, message: "N2O 排放因子 N2O EF(g N2O/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb8: [
          { required: false, message: "2010 CO2e排放因子 CO2e EF不能为空", trigger: "blur" }
        ],
        sb9: [
          { required: false, message: "CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb10: [
          { required: false, message: "CH4 排放因子 CH4 EF (g CH4/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb11: [
          { required: false, message: "N2O 排放因子 N2O EF(g N2O/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb12: [
          { required: false, message: "2011 CO2e排放因子 CO2e EF不能为空", trigger: "blur" }
        ],
        sb13: [
          { required: false, message: " CO2 排放因子 CO2 EF (ton CO2/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb14: [
          { required: false, message: "CH4 排放因子 CH4 EF (g CH4/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb15: [
          { required: false, message: "N2O 排放因子 N2O EF(g N2O/10^6 kJ)不能为空", trigger: "blur" }
        ],
        sb16: [
          { required: false, message: "2006 不能为空", trigger: "blur" }
        ],
        sb17: [
          { required: false, message: "CO2 排放因子 CO2 EF (ton CO2/10MWh)不能为空", trigger: "blur" }
        ],
        sb18: [
          { required: false, message: "CH4 排放因子 CH4 EF (g CH4/10MWh)不能为空", trigger: "blur" }
        ],
        sb19: [
          { required: false, message: "N2O 排放因子 N2O EF(g N2O/10MWh)不能为空", trigger: "blur" }
        ],
        sb20: [
          { required: false, message: "2007 不能为空", trigger: "blur" }
        ],
        sb21: [
          { required: false, message: "CO2 排放因子 CO2 EF (ton CO2/10MWh)不能为空", trigger: "blur" }
        ],
        sb22: [
          { required: false, message: "CH4 排放因子 CH4 EF (g CH4/10MWh)不能为空", trigger: "blur" }
        ],
        sb23: [
          { required: false, message: "N2O 排放因子 N2O EF(g N2O/10MWh)不能为空", trigger: "blur" }
        ],
        sb24: [
          { required: false, message: "2008 不能为空", trigger: "blur" }
        ],
        sb25: [
          { required: false, message: "CO2 排放因子 CO2 EF (ton CO2/10MWh)不能为空", trigger: "blur" }
        ],
        sb26: [
          { required: false, message: "CH4 排放因子 CH4 EF (g CH4/10MWh)不能为空", trigger: "blur" }
        ],
        sb27: [
          { required: false, message: "N2O 排放因子 N2O EF(g N2O/10MWh)不能为空", trigger: "blur" }
        ],
        sb28: [
          { required: false, message: "2009 不能为空", trigger: "blur" }
        ],
        sb29: [
          { required: false, message: "CO2 排放因子 CO2 EF (ton CO2/10MWh)不能为空", trigger: "blur" }
        ],
        sb30: [
          { required: false, message: "CH4 排放因子 CH4 EF (g CH4/10MWh)不能为空", trigger: "blur" }
        ],
        sb31: [
          { required: false, message: "N2O 排放因子 N2O EF(g N2O/10MWh)不能为空", trigger: "blur" }
        ],
        sb32: [
          { required: false, message: "2010 不能为空", trigger: "blur" }
        ],
        sb33: [
          { required: false, message: "CO2 排放因子 CO2 EF (ton CO2/10MWh)不能为空", trigger: "blur" }
        ],
        sb34: [
          { required: false, message: "CH4 排放因子 CH4 EF (g CH4/10MWh)不能为空", trigger: "blur" }
        ],
        sb35: [
          { required: false, message: "N2O 排放因子 N2O EF(g N2O/10MWh)不能为空", trigger: "blur" }
        ],
        sb36: [
          { required: false, message: "2011 不能为空", trigger: "blur" }
        ],
        sb37: [
          { required: false, message: "CO2 排放因子 CO2 EF (ton CO2/10MWh)不能为空", trigger: "blur" }
        ],
        sb38: [
          { required: false, message: "CH4 排放因子 CH4 EF (g CH4/10MWh)不能为空", trigger: "blur" }
        ],
        sb39: [
          { required: false, message: "N2O 排放因子 N2O EF(g N2O/10MWh)不能为空", trigger: "blur" }
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询排放因子列表 */
    getList() {
      this.loading = true;
      listCompanyGrid(this.queryParams).then(response => {
        this.companyGridList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        sb1: undefined,
        sb2: undefined,
        sb3: undefined,
        sb4: undefined,
        sb5: undefined,
        sb6: undefined,
        sb7: undefined,
        sb8: undefined,
        sb9: undefined,
        sb10: undefined,
        sb11: undefined,
        sb12: undefined,
        sb13: undefined,
        sb14: undefined,
        sb15: undefined,
        sb16: undefined,
        sb17: undefined,
        sb18: undefined,
        sb19: undefined,
        sb20: undefined,
        sb21: undefined,
        sb22: undefined,
        sb23: undefined,
        sb24: undefined,
        sb25: undefined,
        sb26: undefined,
        sb27: undefined,
        sb28: undefined,
        sb29: undefined,
        sb30: undefined,
        sb31: undefined,
        sb32: undefined,
        sb33: undefined,
        sb34: undefined,
        sb35: undefined,
        sb36: undefined,
        sb37: undefined,
        sb38: undefined,
        sb39: undefined
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加排放因子";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.reset();
      const id = row.id || this.ids
      getCompanyGrid(id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改排放因子";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          if (this.form.id != null) {
            updateCompanyGrid(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addCompanyGrid(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除排放因子编号为"' + ids + '"的数据项？').then(() => {
        this.loading = true;
        return delCompanyGrid(ids);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
        this.$download.excel('/busi/companyGrid/export', this.queryParams);
    }
  }
};
</script>
